<?php


namespace App\Winged\Middleware;

use Illuminate\Http\Request;

class ErrorResponseMiddle {

    public function handle(Request $request , \Closure $next)
    {
        return $next($request);
    }

    /**
     * Send a response through this middleware.
     *
     * @param \Symfony\Component\HttpFoundation\Response $response
     */
    public static function respond(\Symfony\Component\HttpFoundation\Response $response)
    {
        $next = function () use ($response) {
            return $response;
        };
        (new static())->handle(Request::capture(), $next)->send();
        exit;
    }
}
